package face.pay.dao;

import face.pay.entity.RoleInfo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface RoleInfoDao {

    @Select("select a.* from role a inner join user_role b on " +
            "a.id = b.role_id where b.user_id=#{userId}")
    List<RoleInfo> getUserRoleByUserId(Integer userId);


    @Select("select a.* from role a  where a.code=#{code}")
    RoleInfo getUserRoleByCode(String code);


}
